<template>
  <view class="cm-scroll-selection" :style="[wrapperStyle]">
    <scroll-view v-if="type === 'hor'" class="cm-scroll-selection-hor"
      scroll-x :scroll-with-animation="scrollWithAnimation"
      :scroll-left="scrollPos"
      @scroll="scrollHandler">
      <view class="cm-scroll-selection-hor-item"
        :style="[selectionWrapperStyle]"
        v-for="(item, index) in selections" :key="index"
        @click="clickHandler(item, index)">
        <slot name="item" :item="item" :index="index" :selected="selected === index"></slot>
      </view>
    </scroll-view>
    <!-- 纵向滑动选项 -->
    <scroll-view v-else class="cm-scroll-selection-ver">
      
    </scroll-view>
  </view>
</template>

<script src="./cm-scroll-selection.js"></script>

<style lang="stylus">
@import './cm-scroll-selection.styl'
</style>
